<?php



class Db extends PDO {

    /**
     * @param $db_dsn mysql:host=localhost;dbname=mydb
     * @param string $db_user
     * @param string $db_pass
     */
    public function __construct($db_dsn, $dbuser = "", $db_pass = "") {

        $options = array(
            PDO::ATTR_PERSISTENT => true,
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
        );

        try {
            parent::__construct($db_dsn, $dbuser, $db_pass, $options);
        } catch (PDOException $e) {
          //  $this->error = $e->getMessage();
        }
    }

    /**
     * @param $table
     * @param $where
     * @param string $bind
     */
    public function delete($table, $where, $bind = "") {
        $sql = "DELETE FROM " . $table . " WHERE " . $where . ";";
        $this->run($sql, $bind);
    }
}
